﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfUMLTry1.Model.Quest
{
    abstract class AbstractQuest
    {
        private Int32 _qID; //quest ID
        private Int32 _state;
        private Model.gameModel _gMod;

        public Int32 ID
        {
            get { return _qID;}
        }

        public Int32 state
        {
            get { return _state; }
            set { _state = value; }
        }

        public AbstractQuest(Int32 id, Model.gameModel gMod)
        {
            _qID = id;
            _gMod = gMod;
        }

        abstract public void startQuest(Int32 startState);

        public event EventHandler<Int32> answerChosed;

        public void gotTheAnswer(Int32 ans)
        {
            _gMod.storyState = ans;
            View.Switcher.Switch(new View.InTheTown(_gMod));
            _gMod.followTheSigns();
        }

        protected void OnAnswerChosed(Int32 ans)
        {
            if (answerChosed != null)
                answerChosed(this, ans);
        }

    }
}
